import 'package:data_table_2/data_table_2.dart';
import 'package:flutter/material.dart';

class TestView extends StatefulWidget {
  const TestView({super.key});

  @override
  State<TestView> createState() => _TestViewState();
}

class _TestViewState extends State<TestView> {
  @override
  Widget build(BuildContext context) {
    return
      ConstrainedBox(constraints: const BoxConstraints(maxHeight: 500 ),
        child:
        DataTable2(
            isHorizontalScrollBarVisible:true,
            columnSpacing: 12,
            horizontalMargin: 12,
            minWidth: 1500,
            columns: [
              DataColumn2(
                label: Text('Column A'),
                size: ColumnSize.L,
              ),
              DataColumn2(
                label: Text('Column B'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column C'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column D'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column E'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column F'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column G'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column G'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column G'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column G'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column G'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column G'),
                fixedWidth: 100,
              ),
              DataColumn2(
                label: Text('Column G'),
                fixedWidth: 100,
              ),
              DataColumn(
                label: Text('Column G'),
              ),
              DataColumn(
                label: Text('Column G'),
              ),
              DataColumn(
                label: Text('Column G'),
              ),
              DataColumn(
                label: Text('Column NUMBERS'),
                numeric: true,
              ),
            ],
            rows: List<DataRow>.generate(
                100,
                    (index) => DataRow(cells: [
                  DataCell(Text('A' * (10 - index % 10))),
                  DataCell(Text('B' * (10 - (index + 5) % 10))),
                  DataCell(Text('C' * (15 - (index + 5) % 10))),
                  DataCell(Text('D' * (15 - (index + 10) % 10))),
                  DataCell(Text('E' * (15 - (index + 10) % 10))),
                  DataCell(Text('F' * (15 - (index + 10) % 10))),
                  DataCell(Text('G' * (15 - (index + 10) % 10))),
                  DataCell(Text('G' * (15 - (index + 10) % 10))),
                  DataCell(Text('G' * (15 - (index + 10) % 10))),
                  DataCell(Text('G' * (15 - (index + 10) % 10))),
                  DataCell(Text('G' * (15 - (index + 10) % 10))),
                  DataCell(Text('G' * (15 - (index + 10) % 10))),
                  DataCell(Text('G' * (15 - (index + 10) % 10))),
                  DataCell(Text('G' * (15 - (index + 10) % 10))),
                  DataCell(Text('G' * (15 - (index + 10) % 10))),
                  DataCell(Text('G' * (15 - (index + 10) % 10))),
                  DataCell(Text(((index + 0.1) * 25.4).toString()))
                ]))),


      );
  }
}
